#ifndef _RESPONSE_H_
#define _RESPONSE_H_

#include <string>
#include <vector>

#include "connector.h"

namespace dxy::easyWebServer
{

class Response
{
public:
    Response(int fd);
    ~Response();

    void setHead(const std::string & version = "HTTP/1.0", const std::string & httpCode = "200 OK");
    void add(const std::string & key, const std::string & value);
    void addContext(const std::string & src);

    void send();
    
public:
    std::string                                     m_body;
    std::string                                     m_head;
    std::vector<std::string>                        m_ctx;
private:
    int                                             m_cliFd = -1;
    Connector                                       m_conn;

};

}


#endif